<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	
	class Home extends CI_Controller {

		function __construct()
		{
			parent::__construct();
			$this->load->helper('url');
		}

		public function index()
		{
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/index-content.php", null, true);
			$this->load->view('public/index.php', $data);
		}

		public function index_content()
		{
			$data["flag"] = 6;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/index-content.php", null, true);
			$this->load->view('public/index.php', $data);
		}

		public function training_form()
		{
			$data["flag"] = 6;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/training-forms.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function training_procedure()
		{
			$data["flag"] = 6;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/training-procedure.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function meeting_room_booking()
		{
			$data["flag"] = 6;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["ajax_content"] = $this->load->view("public/ajax-meeting-booking-room.php", null, true);
			$data["content"] = $this->load->view("public/meeting-room-booking.php", $data, true);
			$this->load->view("public/index.php", $data);
		}

		public function ajax_mbr()
		{
			echo $this->load->view("public/ajax-meeting-booking-room.php", null, true);
		}

		public function training_plan()
		{
			$data["flag"] = 1;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view('public/training-plan.php', null, true);
			$this->load->view('public/index.php', $data);
		}

		public function plan_course_detail()
		{
			$data["flag"] = 1;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/plan-course-detail.php", null, true);
			$this->load->view('public/index.php', $data);
		}

		public function material()
		{
			$data["flag"] = 2;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/material.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function Jprofile_material()
		{
			$data["flag"] = 2;
			$data["m_content"] = $this->load->view("public/material-detail.php", null, true);
			$data["content"] = $this->load->view("public/material.php", $data, true);
			$data["login"] = $this->load->view("login/login.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function material_detail()
		{
			echo $this->load->view("public/material-detail.php", null, true);
		}

		public function facilities()
		{
			$data["flag"] = 3;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/facilities.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function facilities_detail()
		{
			$data["flag"] = 3;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/facilities-detail.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function job_profile()
		{
			$data["flag"] = 4;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/job-profile.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function job_profile_detail()
		{
			echo $this->load->view("public/job-profile-detail.php", null, true);
		}

		public function contact_us()
		{
			$data["flag"] = 5;
			$data["login"] = $this->load->view("login/login.php", null, true);
			$data["content"] = $this->load->view("public/contact-us.php", null, true);
			$this->load->view("public/index.php", $data);
		}

		public function Pdf_export()
		{
			$this->load->helper('download');
			$html =  $this->load->view("public/report.php", null, true);
			$this->load->library('Mpdf');
			$mpdf = new Pdf();
			$mpdf->useAdobeCJK = true;
			$mpdf->SetAutoFont(AUTOFONT_ALL);
			$mpdf->writeHTML($html);
			//$mpdf->Image();
			$mpdf->Output();
		}

		public function Download_material()
		{
			$this->load->helper('download');
			$data = file_get_contents("./material/audit.pptx");
			$name = "meeting_management.pptx";
			force_download($name, $data);
		}
	}